package thread;

class  MyThread3 extends Thread{
    public void run() {
        while (true) {
            System.out.println("hello thread");
        try{
            Thread.sleep(1000);
        }catch (InterruptedException e){
                e.printStackTrace();
            }
        }
    }
}
public class Demo2 {
    public static void main(String[] args) {
        Thread thread=new MyThread3();
        thread.start();
    }
}
